<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../00-source/jquery.min.js"></script>
</head>
<body>
    <div id="box">
        <p>11111</p>
        <span>22222</span>
        <div>33333</div>
    </div>

    <script>
        /*
            replaceWith()  替换，被替换的在前，替换它的在括号里
            replaceAll()  一样的功能，也是主宾的区别
        */ 
        let div = $('<div>44444</div>')
        $('#box>span').replaceWith(div)
    </script>
</body>
</html>